﻿using Core.Dtos;
using Core.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Front.Core.Dtos;

namespace Core.IProxyServices
{
    [ServiceContract()]
    public interface IUserStoreService
    {
        [OperationContract()]
        Task<string> CreateAndGetIdAsync(UserDto user);

        [OperationContract()]
        Task DeleteAsync(UserDto user);

        [OperationContract()]
        Task<UserDto> FindByIdAsync(string userId);

        [OperationContract()]
        Task<UserDto> FindByNameAsync(string userName);

        [OperationContract()]
        Task UpdateAsync(UserDto user);

        [OperationContract()]
        Task<string> GetPasswordHashAsync(UserDto user);

        [OperationContract()]
        Task<bool> HasPasswordAsync(UserDto user);

        [OperationContract()]
        Task SetPasswordHashAsync(UserDto user, string passwordHash);

        [OperationContract()]
        Task<string> GetSecurityStampAsync(UserDto user);

        [OperationContract()]
        Task SetSecurityStampAsync(UserDto user, string stamp);

        [OperationContract()]
        Task AddToRoleAsync(UserDto user, string roleName);

        [OperationContract()]
        Task<IList<string>> GetRolesAsync(UserDto user);

        [OperationContract()]
        Task<bool> IsInRoleAsync(UserDto user, string roleName);

        [OperationContract()]
        Task RemoveFromRoleAsync(UserDto user, string roleName);       

        [OperationContract()]
        Task AddLoginAsync(UserDto user, UserLoginInfoTo login);

        [OperationContract()]
        Task<UserDto> FindAsync(UserLoginInfoTo login);

        [OperationContract()]
        Task<IList<UserLoginInfoTo>> GetLoginsAsyncAsTos(UserDto user);

        [OperationContract()]
        Task RemoveLoginAsync(UserDto user, UserLoginInfoTo login);
    }
}
